/**
 * Created by bai on 2015-10-30.
 */
var  AJAX=angular.module('AJAX',[]);
AJAX.factory('request',function($http){
    var http = function(url,dataGet,successFun,failFun){
        $http({
            method:'POST',
            url:url,
            data:dataGet
        }).success(function(data){
            successFun(data);
        })

    }
    var factory={
        http:function(url,data,successFun,failFun){
            http(url,data,successFun,failFun);
        }
    };
    return factory;


});

AJAX.factory('OrderingSystem',function(request){
    //var url='../jsLib/测试路径.php'
    var url='../php/index.php'
    var requestGet = function(data,successFun,failFun){

        request.http(url,data,function(data){
            successFun(data);
        },function(data){
            failFun(data);
        })
    }
    return{
        getMemberList:function(options){

            var  out = {
                "data":options.data,
                "params"    : {},
                "controller": "order",
                "action"    : "getTakeoutAwaitOrderCount"
            };
            requestGet(out, options.successFunction, options.errorFunction);
        }
    }
})